#!/bin/sh
##
## File:        $URL$
## Package:     SAMRAI
## Copyright:   (c) 1997-2019 Lawrence Livermore National Security, LLC
## Revision:    $LastChangedRevision$
## Description: script to suggest ways to configure SAMRAI
##

# Note to SAMRAI developers:
#
#
# This script lists known working configure options and associates
# each configuration with an easy-to-remember index.  Its output can
# be used as options to SAMRAI's configure script.
#
# To add an index, add another case in the case statement, but use the
# following restrictions so that the help message works automatically:
#
# 1. Give your case an index name according to the naming convention.
# 2. Insert your addition in alphabetical order by index name.
# 3. Do not use * or | in the glob pattern.
# 4. Follow the ) with # and a brief (one line) description of
#    the index.  If you leave out the #, the case will be hidden from
#    the help message.
# 5. Add comment that you are maintaining the specific case you added,
#    so that in case of an error, you can be notified.
# 6. After adding a case, run this script without arguments to make
#    sure the help message correctly lists your new addition.
# 7. Try to list the configure options for each entry in the following order:
#       C++ compiler
#       C compiler
#       FORTRAN compiler
#       compiler options
#       HDF
#       MPI
#       Packages stuff (hypre, Sundials, etc.)
#       SAMRAI specific options
#


if test "$1" = '-c'; then
  shift;
  dirname=`echo $0 | sed 's!/[^/]*$!!'`
  if ! test -r "$dirname/configure"; then
    echo "-c is given, but cannot read $dirname/configure."
  fi
  exec $0 "$@" | xargs $dirname/configure
  # The above exec statement unexpecedly returns, maybe due to the |.
  exit $?
fi


case $1 in

#-----------------------------------------------------------------------------
# LC machines
#-----------------------------------------------------------------------------

bgq_mpixlcxx) # BG/Q, using mpixlcxx
cat <<-EOF
	--with-CXX=mpixlcxx
	--with-CC=mpixlc
	--with-F77=mpixlf77
	--with-hdf5=/usr/local/tools/hdf5/hdf5-1.8.5/parallel
	--with-hypre=no
	--without-sundials
	--without-petsc
	--without-x
	--enable-rpath=no
EOF
;;

seq_mpixlcxx) # Sequoia, using mpixlcxx
cat <<-EOF
	--with-CXX=mpixlcxx-fastmpi
	--with-CC=mpixlc-fastmpi
	--with-F77=mpif77
	--with-hdf5=/usr/local/tools/hdf5/hdf5-1.8.5/parallel
	--with-hypre=no
	--without-sundials
	--without-petsc
	--without-x
	--enable-rpath=no
EOF
#
;;

seq_thread_mpixlcxx) # Sequoia, threaded using mpixlcxx
cat <<-EOF
	--with-CXX=/usr/local/tools/compilers/ibm/mpixlcxx_r-lompbeta2-fastmpi
	--with-CC=/usr/local/tools/compilers/ibm/mpixlc_r-lompbeta2-fastmpi
	--with-F77=mpif77
	--with-hdf5=/usr/local/tools/hdf5/hdf5-1.8.5/parallel
	--with-hypre=no
	--without-sundials
	--without-petsc
	--without-x
	--enable-rpath=no
	--enable-threading
EOF
#
;;

chaos5_mpiicc) # CHAOS5, Intel compilers with LLNL mpiicpc front ends
cat <<-EOF
	--with-CC="/usr/local/bin/mpiicc-17.0.174 -gcc-name=/usr/apps/gnu/4.9.2/bin/gcc"
	--with-CXX="/usr/local/bin/mpiicpc-17.0.174 -gxx-name=/usr/apps/gnu/4.9.2/bin/g++ -std=c++11"
	--with-F77="/usr/local/bin/ifort-17.0.174 -gxx-name=/usr/apps/gnu/4.9.2/bin/g++"
	--without-petsc
	--without-x
	--without-sundials
	--disable-shared
	--enable-rpath=-Wl,-R
	--with-zlib
	--with-hdf5=/usr/local/tools/hdf5-intel-parallel-1.8.5
	--with-silo=/usr/gapps/silo/4.8/chaos_5_x86_64_ib
	--with-hypre=/collab/usr/gapps/samrai/devapps/chaos/hypre/2.10.0b.opt
	--without-tbb
EOF
# Maintained by Noah Elliott
;;

chaos5_mpiicc14_cxx11_mpi2) # CHAOS5, Intel v. 14 compilers with LLNL mpiicpc front ends, using C++ 11 standard and MPI2
cat <<-EOF
        --with-CC="/usr/local/bin/mpiicc-17.0.174 -gcc-name=/usr/apps/gnu/4.9.2/bin/gcc -mpi=mvapich2-intel-2.2"
        --with-CXX="/usr/local/bin/mpiicpc-17.0.174 -gxx-name=/usr/apps/gnu/4.9.2/bin/g++ -mpi=mvapich2-intel-2.2 -std=c++11"
        --with-F77="/usr/local/bin/mpiifort-17.0.174 -gxx-name=/usr/apps/gnu/4.9.2/bin/g++ -mpi=mvapich2-intel-2.2"
        --without-petsc
        --without-x
        --without-sundials
        --disable-shared
        --with-zlib
        --with-hdf5=/collab/usr/gapps/samrai/apps/chaos/hdf5/1.8.5p1-serial
        --with-silo=/usr/gapps/silo/4.8/chaos_5_x86_64_ib
        --without-hypre
        --without-tbb
EOF
# Maintained by Noah Elliott
;;

chaos5_clang) # CHAOS5, clang compilers and MPI2
cat <<-EOF
	--with-CC=/usr/global/tools/clang/chaos_5_x86_64_ib/clang-4.0.1/bin/clang
	--with-CXX="/usr/global/tools/clang/chaos_5_x86_64_ib/clang-4.0.1/bin/clang++ -std=c++11"
	--with-F77=/usr/apps/gnu/4.9.3/bin/gfortran
	--without-petsc
        --without-blas
        --without-lapack
	--without-hypre
	--without-x
	--without-sundials
	--disable-shared
	--enable-rpath
        --enable-debug
        --disable-opt
	--with-hdf5=/collab/usr/gapps/samrai/apps/chaos/hdf5/1.8.5p1-serial
	--with-silo=/usr/gapps/silo/4.8/chaos_5_x86_64_ib
	--with-zlib
        --with-mpi-include=/usr/local/tools/mvapich2-intel/include
        --with-mpi-lib-dirs=/usr/local/tools/mvapich2-intel/lib
        --with-mpi-libs="mpichcxx mpich opa mpl pmi"
EOF
# Maintained by Bob Anderson
;;

toss3_gcc) # TOSS3, gnu
cat <<-EOF
	--with-CC="/usr/tce/packages/mvapich2/mvapich2-2.2-intel-16.0.3/bin/mpicc -gcc-name=/usr/tce/packages/gcc/gcc-4.9.3/bin/gcc"
	--with-CXX="/usr/tce/packages/mvapich2/mvapich2-2.2-intel-16.0.3/bin/mpic++ -gxx-name=/usr/tce/packages/gcc/gcc-4.9.3/bin/g++ -std=c++11"
	--with-F77="/usr/tce/packages/mvapich2/mvapich2-2.2-intel-16.0.3/bin/mpif90 -gcc-name=/usr/tce/packages/gcc/gcc-4.9.3/bin/gcc"
	--without-petsc
	--without-x
	--without-sundials
	--disable-shared
	--enable-rpath=-Wl,-R
	--with-zlib
	--with-hdf5=/usr/tce/packages/hdf5/hdf5-serial-1.8.18-intel-16.0.3
	--with-silo=/usr/gapps/silo/4.10.3/toss_3_x86_64_icc
	--without-hypre
	--without-tbb
EOF
# Maintained by Bob Anderson
;;

surface_pgi_15) # Surface using pgi accelerator compilers
cat <<-EOF
        --with-CXX=/usr/local/tools/pgi-15.5-accelerator/linux86-64/15.5/bin/pgCC
        --with-CC=/usr/local/tools/pgi-15.5-accelerator/linux86-64/15.5/bin/pgcc
        --with-F77=/usr/local/tools/pgi-15.5-accelerator/linux86-64/15.5/bin/pgf77
        --with-hdf5=/collab/usr/gapps/samrai/apps/chaos/hdf5/1.8.5p1-serial
EOF
# Maintained by Bob Anderson
;;

edge_gcc) # Edge with default GNU GCC compilers
cat <<-EOF
	--with-CXX=/usr/local/bin/g++
	--with-CC=/usr/local/bin/gcc
	--with-F77=/usr/local/bin/gfortran
	--with-silo=/usr/gapps/silo/4.6.2/chaos_4_x86_64
	--with-hdf5=/usr/gapps/silo/hdf5/1.8.4/chaos_4_x86_64
	--with-szlib=/usr/gapps/silo/szip/2.1/chaos_4_x86_64
	--with-zlib
	--with-hypre=/collab/usr/gapps/samrai/devapps/chaos/hypre/2.10.0b.opt
EOF
;;

#-----------------------------------------------------------------------------
# CASC machines
#-----------------------------------------------------------------------------

cygwin)
# Cygwin compile
cat <<-EOF
	--with-CXX=mpicxx
	--with-CC=mpicc
	--with-F77=mpif77
	--with-hdf5=/usr
	--without-x
EOF
;;

cygwin_ccache)
# Cygwin compile
cat <<-EOF
	--with-CXX="ccache mpicxx"
	--with-CC="ccache mpicc"
	--with-F77=mpif77
	--with-hdf5=/usr
	--without-x
EOF
;;

casc_rh5_gnu_x64) # CASC RedHat 5, default GNU compilers, x86_64
cat <<-EOF
	--with-CXX=/usr/bin/g++
	--with-CC=/usr/bin/gcc
	--with-F77=/usr/bin/gfortran
	--with-hdf5=/usr/casc/samrai/apps/rh5/hdf5/1.8.5p1
	--with-silo=/usr/casc/samrai/apps/rh5/silo/4.7.2_opt
	--with-mpi-include=/usr/apps/mpich2/1.3.2/include
	--with-mpi-lib-dirs=/usr/apps/mpich2/1.3.2/lib
	--with-mpi-libs="mpich mpl rt pthread"
	--with-parallel-run-bin=/usr/apps/mpich2/1.3.2/bin/mpirun
	--with-hypre=/usr/casc/samrai/apps/rh5/hypre/2.10.0b.gcc.4.1.2.opt
	--with-lapack=/usr/casc/samrai/apps/rh5/lapack/3.2.2-gcc.4.1.2
	--with-lapack-libs="-L/usr/casc/samrai/apps/rh5/lapack/3.2.2-gcc.4.1.2/lib -llapack"
	--with-blas=/usr/casc/samrai/apps/rh5/lapack/3.2.2-gcc.4.1.2
	--with-blas-libs="-L/usr/casc/samrai/apps/rh5/lapack/3.2.2-gcc.4.1.2/lib -lf77blas -lcblas -latlas"
	--with-petsc=/usr/casc/samrai/apps/rh5/petsc/petsc-3.2-p7.gcc.4.1.2
	--with-sundials=/usr/casc/samrai/apps/rh5/sundials/2.3.0_gcc.4.1.2
	--enable-rpath=-Wl,-R
EOF
#
;;

# TODO Need to add in other support libraries in order to get complete
# coverage
casc_rh5_insure) # CASC RedHat 5, Insure++ with default GNU compilers,
cat <<-EOF
	--with-CXX="/usr/apps/insure++/7.1.7/bin/insure /usr/bin/g++"
	--with-CC="/usr/apps/insure++/7.1.7/bin/insure /usr/bin/gcc"
	--with-F77=/usr/bin/gfortran
	--with-hdf5=/nfs/casc/samrai/apps/rh5/hdf5/1.8.5p1
	--with-silo=/nfs/casc/samrai/apps/rh5/silo/4.7.2_opt
	--with-mpi-include=/usr/apps/mpich2/1.3.2/include
	--with-mpi-lib-dirs=/usr/apps/mpich2/1.3.2/lib
	--with-mpi-libs="mpich mpl rt pthread"
	--with-parallel-run-bin=/usr/apps/mpich2/1.3.2/bin/mpirun
	--with-hypre=/usr/casc/samrai/apps/rh5/hypre/2.10.0b.gcc.4.1.2.opt
	--with-lapack=/usr/casc/samrai/apps/rh5/lapack/3.2.2-gcc.4.1.2
	--with-lapack-libs="-L/usr/casc/samrai/apps/rh5/lapack/3.2.2-gcc.4.1.2/lib -llapack"
	--with-blas=/usr/casc/samrai/apps/rh5/lapack/3.2.2-gcc.4.1.2
	--with-blas-libs="-L/usr/casc/samrai/apps/rh5/lapack/3.2.2-gcc.4.1.2/lib -lf77blas -lcblas -latlas"
	--with-petsc=/usr/casc/samrai/apps/rh5/petsc/petsc-3.2-p7.gcc.4.1.2
	--with-sundials=/usr/casc/samrai/apps/rh5/sundials/2.3.0_gcc.4.1.2
	--enable-rpath=-Wl,-R
EOF
#
;;

casc_rh5_icc_x64) # CASC RedHat 5, Intel v12.0 compilers, x86_64
cat <<-EOF
	--with-CXX="/nfs/apps/intel/12.0.191/bin/icpc -Kc++ -gcc-name=/usr/bin/gcc"
	--with-CC="/nfs/apps/intel/12.0.191/bin/icc -gcc-name=/usr/bin/gcc"
	--with-F77=/nfs/apps/intel/12.0.191/bin/ifort
	--with-extra-ld-flags="-shared-intel"
	--enable-rpath=-Wl,-R
	--with-hdf5=/usr/casc/samrai/apps/rh5/hdf5/1.8.5p1
	--with-silo=/usr/casc/samrai/apps/rh5/silo/4.7.2_opt
	--with-mpi-include=/usr/apps/mpich2/latest/include
	--with-mpi-lib-dirs=/usr/apps/mpich2/latest/lib
	--with-mpi-libs="mpich mpl rt pthread"
	--with-parallel-run-bin=/usr/apps/mpich2/latest/bin/mpirun
	--with-hypre=no
	--without-petsc
	--with-x
EOF
;;

casc_rh5_gnu45_x64) # CASC RedHat 5, GNU-4.5.0 compilers, x86_64
cat <<-EOF
	--with-CXX=/nfs/apps/gcc/4.5.0/bin/g++
	--with-CC=/nfs/apps/gcc/4.5.0/bin/gcc
	--with-F77=/nfs/apps/gcc/4.5.0/bin/gfortran
	--with-hdf5=/usr/casc/samrai/apps/rh5/hdf5/1.8.5p1
	--with-silo=/usr/casc/samrai/apps/rh5/silo/4.7.2_opt
	--with-mpi-include=/nfs/casc/samrai/apps/rh5/openmpi/1.5-gcc-4.5.0.opt/include
	--with-mpi-lib-dirs=/nfs/casc/samrai/apps/rh5/openmpi/1.5-gcc-4.5.0.opt/lib
	--with-mpi-libs="mpi rt"
	--with-parallel-run-bin=/nfs/casc/samrai/apps/rh5/openmpi/1.5-gcc-4.5.0.opt/bin/mpirun
	--with-hypre=/usr/casc/samrai/apps/rh5/hypre/2.10.0b.opt
	--with-lapack=/usr/casc/samrai/apps/rh5/lapack/3.2.2-gcc.4.5.0
	--with-lapack-libs="-L/usr/casc/samrai/apps/rh5/lapack/3.2.2-gcc.4.5.0/lib -llapack"
	--with-blas=/usr/casc/samrai/apps/rh5/lapack/3.2.2-gcc.4.5.0
	--with-blas-libs="-L/usr/casc/samrai/apps/rh5/lapack/3.2.2-gcc.4.5.0/lib -lf77blas -lcblas -latlas"
	--with-petsc=/usr/casc/samrai/apps/rh5/petsc/petsc-3.2-p7
	--with-sundials=/usr/casc/samrai/apps/rh5/sundials/2.3.0
	--with-x
EOF
;;

casc_rh5_gnu45_b46) # CASC RedHat 5, GNU-4.5.0 compilers, x86_64, Boost 1.46.1
cat <<-EOF
	--with-CXX=/nfs/apps/gcc/4.5.0/bin/g++
	--with-CC=/nfs/apps/gcc/4.5.0/bin/gcc
	--with-F77=/nfs/apps/gcc/4.5.0/bin/gfortran
	--with-hdf5=/usr/casc/samrai/apps/rh5/hdf5/1.8.5p1
	--with-silo=/usr/casc/samrai/apps/rh5/silo/4.7.2_opt
	--with-mpi-include=/nfs/casc/samrai/apps/rh5/openmpi/1.5-gcc-4.5.0.opt/include
	--with-mpi-lib-dirs=/nfs/casc/samrai/apps/rh5/openmpi/1.5-gcc-4.5.0.opt/lib
	--with-mpi-libs="mpi rt"
	--with-parallel-run-bin=/nfs/casc/samrai/apps/rh5/openmpi/1.5-gcc-4.5.0.opt/bin/mpirun
	--with-hypre=/usr/casc/samrai/apps/rh5/hypre/2.10.0b.opt
	--with-lapack=/usr/casc/samrai/apps/rh5/lapack/3.2.2-gcc.4.5.0
	--with-lapack-libs="-L/usr/casc/samrai/apps/rh5/lapack/3.2.2-gcc.4.5.0/lib -llapack"
	--with-blas=/usr/casc/samrai/apps/rh5/lapack/3.2.2-gcc.4.5.0
	--with-blas-libs="-L/usr/casc/samrai/apps/rh5/lapack/3.2.2-gcc.4.5.0/lib -lf77blas -lcblas -latlas"
	--with-petsc=/usr/casc/samrai/apps/rh5/petsc/petsc-3.2-p7
	--with-sundials=/usr/casc/samrai/apps/rh5/sundials/2.3.0
	--with-x
EOF
;;

casc_rh5_gnu46_x64) # CASC RedHat 5, GNU-4.6.0 compilers, x86_64
cat <<-EOF
	--with-CXX=/usr/casc/samrai/apps/rh5/gcc/4.6.0/bin/g++
	--with-CC=/usr/casc/samrai/apps/rh5/gcc/4.6.0/bin/gcc
	--with-F77=/usr/casc/samrai/apps/rh5/gcc/4.6.0/bin/gfortran
	--with-hdf5=/usr/casc/samrai/apps/rh5/hdf5/1.8.5p1
	--with-silo=/usr/casc/samrai/apps/rh5/silo/4.7.2_opt
	--with-mpi-include=/nfs/casc/samrai/apps/rh5/openmpi/1.5-gcc-4.5.0.opt/include
	--with-mpi-lib-dirs=/nfs/casc/samrai/apps/rh5/openmpi/1.5-gcc-4.5.0.opt/lib
	--with-parallel-run-bin=/nfs/casc/samrai/apps/rh5/openmpi/1.5-gcc-4.5.0.opt/bin/mpirun
	--with-mpi-libs="mpi rt"
	--with-hypre=/usr/casc/samrai/apps/rh5/hypre/2.10.0b.opt
	--with-petsc=/usr/casc/samrai/apps/rh5/petsc/petsc-3.2-p7
	--with-lapack=/usr/casc/samrai/apps/rh5/lapack/3.2.2-gcc.4.5.0
	--with-lapack-libs="-L/usr/casc/samrai/apps/rh5/lapack/3.2.2-gcc.4.5.0/lib -llapack"
	--with-blas=/usr/casc/samrai/apps/rh5/lapack/3.2.2-gcc.4.5.0
	--with-blas-libs="-L/usr/casc/samrai/apps/rh5/lapack/3.2.2-gcc.4.5.0/lib -lf77blas -lcblas -latlas"
	--with-sundials=/usr/casc/samrai/apps/rh5/sundials/2.3.0
	--with-x
EOF
;;

# CASC RedHat 6, default GNU compilers, x86_64. The only reason this
# is different from Redhat 5 is that things hosted on /usr/apps have
# different versions installed.

casc_rh6_gnu_x64)  # CASC RedHat 6, default GNU compilers
cat <<-EOF
	--with-CXX=/usr/bin/g++
	--with-CC=/usr/bin/gcc
	--with-F77=/usr/bin/gfortran
	--with-hdf5=/usr/casc/samrai/apps/rh5/hdf5/1.8.5p1
	--with-silo=/usr/casc/samrai/apps/rh5/silo/4.7.2_opt
	--with-mpi-include=/usr/apps/mpich2/latest/include
	--with-mpi-lib-dirs=/usr/apps/mpich2/latest/lib
	--with-mpi-libs="mpich mpl rt pthread"
	--with-parallel-run-bin=/usr/apps/mpich2/latest/bin/mpirun
	--with-hypre=/usr/casc/samrai/apps/rh5/hypre/2.10.0b.gcc.4.1.2.opt
	--with-lapack=/usr/casc/samrai/apps/rh5/lapack/3.2.2-gcc.4.1.2
	--with-lapack-libs="-L/usr/casc/samrai/apps/rh5/lapack/3.2.2-gcc.4.1.2/lib -llapack"
	--with-blas=/usr/casc/samrai/apps/rh5/lapack/3.2.2-gcc.4.1.2
	--with-blas-libs="-L/usr/casc/samrai/apps/rh5/lapack/3.2.2-gcc.4.1.2/lib -lf77blas -lcblas -latlas"
	--with-petsc=/usr/casc/samrai/apps/rh5/petsc/petsc-3.2-p7.gcc.4.1.2
	--with-sundials=/usr/casc/samrai/apps/rh5/sundials/2.3.0_gcc.4.1.2
	--enable-rpath=-Wl,-R
EOF
#
;;


casc_rh6_gnu48_x64)   # CASC RedHat 6, GNU-4.8.1 compilers
cat <<-EOF
	--with-CXX=/usr/apps/gcc/4.8.1/bin/g++
	--with-CC=/usr/apps/gcc/4.8.1/bin/gcc	
	--with-extra-cxx-flags="-Wno-unused-local-typedefs"
	--with-F77=/usr/apps/gcc/4.8.1/bin/gfortran
	--with-hdf5=/usr/casc/samrai/apps/rh5/hdf5/1.8.5p1
	--with-silo=/usr/casc/samrai/apps/rh5/silo/4.7.2_opt
	--with-mpi-include=/usr/apps/mpich2/latest/include
	--with-mpi-lib-dirs=/usr/apps/mpich2/latest/lib
	--with-mpi-libs="mpich mpl rt pthread"
	--with-parallel-run-bin=/usr/apps/mpich2/latest/bin/mpirun
	--with-hypre=/usr/casc/samrai/apps/rh5/hypre/2.10.0b.gcc.4.1.2.opt
	--with-lapack=/usr/casc/samrai/apps/rh5/lapack/3.2.2-gcc.4.1.2
	--with-lapack-libs="-L/usr/casc/samrai/apps/rh5/lapack/3.2.2-gcc.4.1.2/lib -llapack"
	--with-blas=/usr/casc/samrai/apps/rh5/lapack/3.2.2-gcc.4.1.2
	--with-blas-libs="-L/usr/casc/samrai/apps/rh5/lapack/3.2.2-gcc.4.1.2/lib -lf77blas -lcblas -latlas"
	--with-petsc=/usr/casc/samrai/apps/rh5/petsc/petsc-3.2-p7.gcc.4.1.2
	--with-sundials=/usr/casc/samrai/apps/rh5/sundials/2.3.0_gcc.4.1.2
	--enable-rpath=-Wl,-R
EOF
#
;;

# CASC RedHat 7, GNU 4.9.2


casc_rh7_gnu49_x64)   # CASC RedHat 7, GNU-4.9.2 compilers
cat <<-EOF
	--with-CXX=/nfs/apps/gcc/4.9.2/bin/g++
	--with-CC=/nfs/apps/gcc/4.9.2/bin/gcc	
	--with-extra-cxx-flags="-Wno-unused-local-typedefs"
	--with-F77=/nfs/apps/gcc/4.9.2/bin/gfortran
	--with-hdf5=/usr/casc/samrai/apps/rh5/hdf5/1.8.5p1
	--with-silo=/usr/casc/samrai/apps/rh5/silo/4.7.2_opt
	--with-mpi-include=/nfs/apps/mpich2/latest/include
	--with-mpi-lib-dirs=/nfs/apps/mpich2/latest/lib
	--with-mpi-libs="mpich mpl rt pthread"
	--with-parallel-run-bin=/nfs/apps/mpich2/latest/bin/mpirun
	--with-hypre=/usr/casc/samrai/apps/rh5/hypre/2.10.0b.gcc.4.1.2.opt
	--with-lapack=/usr/casc/samrai/apps/rh5/lapack/3.2.2-gcc.4.1.2
	--with-lapack-libs="-L/usr/casc/samrai/apps/rh5/lapack/3.2.2-gcc.4.1.2/lib -llapack"
	--with-blas=/usr/casc/samrai/apps/rh5/lapack/3.2.2-gcc.4.1.2
	--with-blas-libs="-L/usr/casc/samrai/apps/rh5/lapack/3.2.2-gcc.4.1.2/lib -lf77blas -lcblas -latlas"
	--with-petsc=/usr/casc/samrai/apps/rh5/petsc/petsc-3.2-p7.gcc.4.1.2
	--with-sundials=/usr/casc/samrai/apps/rh5/sundials/2.3.0_gcc.4.1.2
	--enable-rpath=-Wl,-R
EOF
#
;;

#-----------------------------------------------------------------------------
# Misc other machines
#-----------------------------------------------------------------------------

macosx_gnu)
# Apple Mac OS/X, gnu 4.2 compilers from DawrwinPorts
cat <<-EOF
	--with-CXX=g++-mp-4.3
	--with-CC=gcc-mp-4.3
	--with-F77=gfortran-mp-4.3
	--with-hdf5=/opt/local
	--with-mpi-include=/usr/include
	--with-mpi-lib-dirs=/usr/lib
	--with-mpi-libs="mpi"
	--with-parallel-run-bin=/usr/bin/mpirun
EOF
;;


*) # Bad index or no index given, so provide help message.

basename=`echo $0 | sed 's!.*/!!'`

cat <<-EOF

	Usage: $basename <config name> [more switches]

	This script suggests configure options for configuring SAMRAI
	on platforms on which the SAMRAI team have some experience.

	The output of this script, edited to suit your needs,
	can be used as options for SAMRAI's configure script.
	For example, you may want to add "--enable-opt --disable-debug"
	for an optimized compile.  To remove packages you may not need,
	say pvode, change "--with-pvode=/path/to/pvode" to "--without-pvode".
	Any argument after <config name> is simply regurgitated.

	For an explanation of the configure script options,
	use configure's --help option.

	Valid configuration names are:

	EOF
sed -e '/^[ 	]\{0,\}[-_a-zA-Z0-9]\{1,\}[ 	]\{0,\})[ 	]\{0,\}#/!d' -e 's/^[ 	]\{0,\}\([-_a-zA-Z0-9]\{1,\}\)[ 	]\{0,\})[ 	]\{0,\}#[ 	]\{0,\}\(.\{0,\}\)/\1	\2/' -e h -e 's/^[^	]\{0,\}	//' -e x -e 's/	.\{0,\}$//' -e ':a' -e 's/^.\{1,15\}$/ &/' -e 'ta' -e G -e 's/\n/ = /' $0
cat <<-EOF

	Hints:

	Shortcut to avoid having to manually paste the output
	when you want to use it without modification:

	  $basename <config name> --enable-opt | xargs /path/to/SAMRAI/configure
	or
	  eval /path/to/SAMRAI/configure \`$basename <config name> --enable-opt\`

	Note the added "--enable-opt" is included in the configuration switches.

	To remove line-breaks for command line editing (less readable):

	echo \`$basename <config name> --enable-opt\`

	EOF
test $# = 0 && exit	# Normal exit if no index was given.
exit 1	# Error exit if given bad index.
;;


esac

# Regurgitate everything except the <config name> argument.
shift
echo "$@"

#

